﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Banner.Master" CodeBehind="details.aspx.vb" Inherits="ETeacherforIELTS.details" 
    title="Details page" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
  
    <link href="style.css" rel="stylesheet" type="text/css" />
  
    <style type="text/css">
        .style18
        {
            width: 100%;
        }
        .style19
        {
            width: 142px;
        }
        .style20
        {
            font-size: 10.0pt;
            font-family: Calibri, sans-serif;
            font-weight: bold;
            color: #003366;
            width: 25%;
        }
    </style>
  
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  
    
    <table class="bgStyle">
        <tr>
            <td class="sides">
               
            </td>
            <td>
                  <%--<asp:Rating ID="Rating1" runat="server">
                  <asp:Rating  BorderWidth="1" BorderStyle="Solid"
                            width="200" 
                            Height="100" 
                            ID="Rating2"  
                            CurrentRating="2" 
                            runat="server" 
                            StarCssClass="ratingStar" 
                            WaitingStarCssClass="savedRatingStar" 
                            EmptyStarCssClass="emptyRatingStar" 
                            filledStarCssClass="filledRatingStar"
                            MaxRating="5" 
                            >
                 </asp:Rating>

                  </asp:Rating>--%>
                  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  Width="100%"
        DataSourceID="dsDetailsbyID" DataKeyNames="ID,File">
        <Columns>
            <asp:TemplateField>
            
            <ItemTemplate>
            
            
            <table class="bgStyle">
        <tr>
            <td class="TitleStyle" style="width:25%" align="right">
                Material Name &nbsp;&nbsp;&nbsp;:</td>
            <td class="databoundStyle">
                <asp:Label ID="lbMaterialName"  Text='<%#Eval("MaterialName") %>' runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="TitleStyle" align="right" valign="top">
                Description &nbsp;&nbsp;&nbsp;  :</td>
            <td class="databoundStyle">
                <asp:Label ID="lbDescription" Text='<%#Eval("Description") %>' runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="TitleStyle" align="right">
                Category  &nbsp;&nbsp;&nbsp;  :</td>
            <td class="databoundStyle">
                <asp:Label ID="lbCatergory" Text='<%#Eval("Category") %>' runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="TitleStyle" align="right">
                File Download  &nbsp;&nbsp;&nbsp; :</td>
            <td class="databoundStyle">
                <asp:HyperLink ID="hlFile" Text='<%#Eval("File") %>'  runat="server">[hlFile]
               </asp:HyperLink> 
                <asp:HiddenField ID="HiddenField1" Value =' <%#Eval("File") %>' runat="server" />
                &nbsp;<asp:LinkButton ID="LinkButton4" runat="server" 
                      CommandName="edit" >Download</asp:LinkButton>
                &nbsp;(<asp:Label ID="Label1" runat="server" Text='<%#Eval("DownloadCount") %>'> downloads</asp:Label>)</td>
        </tr>
                
        <tr>
            <td class="TitleStyle" align="right">
                Picture   &nbsp;&nbsp;&nbsp; :</td>
            <td class="databoundStyle">
                <asp:Image ID="imgImage" runat="server" ImageUrl = '<%# Eval("Picture") %>' 
                    style="margin-right: 0px" Height="61px" Width="84px" />
            </td>
        </tr>
        <%--<tr>
            <td class="TitleStyle" align="right">
                Stars  &nbsp;&nbsp;&nbsp;  :</td>
            <td class="databoundStyle">
                <asp:Label ID="lbStars" Text='<%#Eval("Stars") %>' runat="server"></asp:Label>
            </td>
        </tr>--%>
        <tr>
            <td class="TitleStyle" align="right">
                Visited Count &nbsp;&nbsp;&nbsp;   :</td>
            <td class="databoundStyle">
                <asp:Label ID="lbVisitedCount" Text='<%#Eval("VisitedCount") %>' runat="server"></asp:Label></td>
        </tr>
        <tr>
        <td colspan="2">
        <table width="100%" border="0"   class="TitleStyle" >
         <tr>
          <td >
          
           <asp:label ID="lblRating" runat="server"></asp:label>
            </td>
         </tr>
</table>
        </td>
        </tr>
    </table>
            </ItemTemplate>
            <HeaderTemplate  ><h1 class="HeadingStyle">Detail Description</h1> </HeaderTemplate>
            </asp:TemplateField>
        </Columns>
    
    </asp:GridView>
    
    
    <asp:SqlDataSource ID="dsDetailsbyID" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [ID], [MaterialName], [Description], [Category], [File], [Picture], [Stars], [VisitedCount], [DownloadCount] FROM [MaterialCollection] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" 
                QueryStringField="materialID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    </td>
            <td class="sides">
                <table class="style18">
                    <tr>
                        <td>
                            <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
                                DataSourceID="SqlDataSource1" CssClass ="TitleStyle" DataTextField="TagName" DataValueField="ID">
                            </asp:CheckBoxList>
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                                SelectCommand="SELECT [ID], [TagName] FROM [Tags]"></asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td class ="TitleStyle">
                            Add a new tag</td>
                    </tr>
                    <tr>
                        <td>
                            <asp:TextBox ID="txtTag" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="Button1" runat="server" Text="Submit" />
                        </td>
                    </tr>
                </table>
            </td>
            <td class="sides">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="sides">
               
                &nbsp;</td>
            <td class ="ratingFont">
    
                RATING FOR THE GIVEN MATERIAL
     <asp:Rating  BorderWidth="0" BorderStyle="Solid"
    width="242px" 
    Height="26px" 
    ID="Rating3"  
    runat="server" 
    StarCssClass="ratingStar" 
    WaitingStarCssClass="savedRatingStar" 
    EmptyStarCssClass="emptyRatingStar" 
    filledStarCssClass="filledRatingStar"
    MaxRating="5" 
    >
    </asp:Rating>

    
    
                  <asp:Button ID="Button2" CssClass ="ratingFont " runat="server" Text="Submit My Rating" />

    </td>
            <td class="sides">
                &nbsp;</td>
            <td class="sides">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="sides">
               
                &nbsp;</td>
            <td class ="ratingFont">
            AVERAGE RATING FOR THE GIVEN MATERIAL
                  <asp:Rating ID="Rating4" runat="server" BorderStyle="Solid" BorderWidth="0" 
                      EmptyStarCssClass="emptyRatingStar" 
                      filledStarCssClass="filledRatingStar" Height="26px" MaxRating="5" 
                      StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" width="242px" ReadOnly = "true">
                  </asp:Rating>

    </td>
            <td class="sides">
                &nbsp;</td>
            <td class="sides">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="sides">
               
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td class="sides">
                &nbsp;</td>
            <td class="sides">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="sides">
               
                &nbsp;</td>
            <td colspan="2">
           <%-- <asp:Accordion ID="Accordion1" runat="server" ContentCssClass="content" HeaderCssClass="header">
    <Panes>--%>
                <asp:Repeater ID="Repeater1" runat="server">
               <ItemTemplate>
                <table class="discussiontable">
                    <tr class ="discussion ">
                        <td colspan="2" class ="discussionFont">
                           <img src="images/icon_minipost.gif"/>Posted : <%#Eval("Title")%>                          </td>
                    </tr>
                    <tr>
                    <tr>
                        <td colspan="2" class ="discussionFontdate">
                           on <%#Eval("PostedDate")%> by <%#Eval("UserName")%>  </td>
                    </tr>
                    <tr>
                        <td class ="discussionbody">
                            <%#Eval("Body")%> 
                        </td>
                    </tr>
                </table>
                   <br>
                </br>
                 </ItemTemplate>
                </asp:Repeater>
                <%--</Panes></asp:Accordion>--%>

    </td>
            <td class="sides">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="sides">
               
                &nbsp;</td>
            <td colspan="2">
                  &nbsp;</td>
            <td class="sides">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="sides">
               
                &nbsp;</td>
            <td colspan="2">
                <table class ="bgStyle">
                    <tr>
                        <td class= "style20">
                            Title</td>
                        <td>
                            <asp:TextBox ID="txtTitle" runat="server" Height="17px" Width="75%"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class= "style20">
                            Body</td>
                        <td>
                            <asp:TextBox ID="txtBody" runat="server" Height="126px" TextMode="MultiLine" 
                                Width="75%"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Button ID="Button3" runat="server" Text="Submit" Width="55px" />
                        </td>
                    </tr>
                </table>

    </td>
            <td class="sides">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="sides">
               
                &nbsp;</td>
            <td colspan="2">
                  &nbsp;</td>
            <td class="sides">
                &nbsp;</td>
        </tr>
    </table>
    
     <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                </asp:ToolkitScriptManager>
    
    
         
</asp:Content>
